import http from "../axios";

export const insuranceCompanyApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/insuranceCompany/pageData`,
    data
  });
};

//增加保险公司
export const saveOrUpdateInsuranceCompanyApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/insuranceCompany/saveOrUpdateInsuranceCompany`,
    data
  });
};

//保险公司-变更停用-启用状态
export const changeStatusApi = (id: string) => {
  return http({
    method: "put",
    url: `/base/biz/insuranceCompany/changeStatus/${id}`
  });
};

//保险公司-查看详情
export const getDetailApi = (id: string) => {
  return http({
    method: "get",
    url: `/base/biz/insuranceCompany/getDetail/${id}`
  });
};

//保险公司-下拉列表-所有无过滤
export const getAllSelectListApi = () => {
  return http({
    method: "get",
    url: `/base/biz/insuranceCompany/getAllSelectList`
  });
};

//保险公司-下拉列表-按运单取对应代理配置的公司
export const getBusinessSelectListApi = (waybillId: string) => {
  return http({
    method: "get",
    url: `/base/biz/insuranceCompany/getBusinessSelectList/${waybillId}`
  });
};

//保险公司-设置下单截止时间规则
export const updateOrderEndTimeApi = (data: { orderEndType: string; orderEndDays: number; insuranceCompanyIdList: string[] }) => {
  return http({
    method: "post",
    url: `/base/biz/insuranceCompany/updateOrderEndTime`,
    data
  });
};
